<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>v-for遍历</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <ul>
        <!--:key为属性绑定一个唯一标识,用来提升性能-->
        <li v-for="(user,idx) in users" :key="idx">
            {{ idx }},{{ user.name }},{{ user.age }},{{ user.gender }}
        </li>
    </ul>
    <hr>
    <ul>
        <li v-for="(value,key,idx) in person">
            {{ idx }},{{ key }},{{ value }}
        </li>
    </ul>
</div>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            users: [
                {"name": "jack", "age": 25, "gender": "男"},
                {"name": "rose", "age": 23, "gender": "女"},
                {"name": "tom", "age": 27, "gender": "男"}
            ],
            person: {"name": "AA", "age": 10, "address": "中国"}
        }
    });
</script>
</body>
</html>